/*
 * $Id$
 */
package py.windmill.util;

import javax.sql.DataSource;

/**
 *
 * @author myang
 */
public class DataSources {

    private static DataSource _ds = 
            DataSourceFactory.newDataSource(getDatabase());;

    private static Database getDatabase() {
        try {
            return new AppFogDatabaseFactory().newDatabase();
        }
        catch (Exception ex) {
            final String p = "/py/windmill/util/ds.properties";
            return new PropertiesDatabaseFactory(p).newDatabase();
        }
    }

    public static final DataSource getDataSource() {
        return _ds;
    }

}
